<template>
	<view class="Grid">
		<view class="Grid-Item" v-for="item in List" :key="item.id" @click="toover(item.carid)">
			<view class="GStitle"><view class="text1">时间{{ item.cardate }}</view></view>
			<view class="GStitle"><view class="text1">单号{{ item.id }}</view></view>
			<view class="GStitle"><view class="text1">使用情况:正在使用</view></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				List:[]
			}
		},
		onShow() {
			let uid = uni.getStorageSync('username');
			uni.request({
				url: 'http://116.62.213.195/car.php',
				data:{
					method: 'dshow',
					userid: uid
				},
				header: {'content-type' : "application/x-www-form-urlencoded"},
				method:'POST',
				success: res =>{
					if(res.data.code == '200'){
						this.List=JSON.parse(JSON.stringify(res.data.data));
						console.log(this.List);
				    }else{
						this.List=0;
				        console.log("加载失败");
				    }
				}
			});
		},
		methods: {
			toover:function(e){
				console.log(e);
				uni.navigateTo({
					url:'../over/over?id='+e
				})
			}
				
		}
	}
</script>

<style>
.Grid{
	display: flex;
	flex-wrap: wrap;
	width: auto;
	height: 70px;
}
.Grid-Item{
	margin-bottom: 2px;
	width: 99%;
	height: 100%;
	display: flex;
	flex-wrap: wrap;
	background-color: #007AFF;
	border-radius: 7px;
	border:1px solid #7a7a7a;
}
.GSimg{
	
}
.Image{
	width: 60px;
	height: 60px;
}
.GStitle{
	width: 40%;
	text-align: center;
	margin: auto;
}
.text1{
	
	width: 100%;
}
</style>
